package com.zhongcw.test.spring.boot.send.request.util;

import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ZCW
 * @createTime 2017/12/13
 * @lastUpdateTime 2017/12/13 ZCW
 */
public class SendRequest {

    public static String URL = "http://localhost:8080/charset";

    public static Map<String, String> param = new HashMap();

    public Object getRestTemplate() {

        Object resultMap = new RestTemplate().getForObject(
                URL + "?" + "param=" + param.get("param"),
                Object.class
        );

        ResponseEntity responseEntity =new RestTemplate().getForEntity(
                URL + "?" + "param=" + param.get("param"),
                Object.class
        );

        return resultMap;
    }

}
